
function hostinfo(hst)
{

    if(document.hiddenhostinfo) { return; }

    outp="";
    outp+="<img width='35%' src='" + hst.image + "' align='left'/>";

    if(hst.ip) { 
      outp+="<h3>" + hst.ip+ "</h3>";
    }
    
    if(hst.ap!=null && hst.essid!=null) { outp+="<b><big> Access Point </big><br/>Essid: " + hst.essid + "</b>"; } 

    for(var i=0; i<hst.summary.length; i++) {
      outp+="<b><big>" + hst.summary[i] + "</big></b>";
    }    
    if(hst.os) { outp+="<br/><b>" + hst.os + "</b>"; }

    if(hst.isInNetmask && hst.isInNetmask==false) { outp+="<i> Address not in local subnet </i>"; }
    
    if(res = getResolved(hst.ip)) { 
      outp+="<table id='tableservices'><tr><td width='30%'>Resolved:</td><td><b>" + res + "</b></td></tr></table>";
    }
    
    outp+="<table id='tableservices'><tr><td width='30%'>Mac address:</td><td><b>" + hst.mac + "</b></td></tr>";
    if(hst.macm) { outp+="<tr><td>Manifacturer:</td><td>" + hst.macm + "</i></td></tr>"; }
    outp+="</table>";
    
    if(hst.os || hst.osver) {
      outp+="<table id='tableservices'><tr><td width='30%'>OS:</td><td><b> ";
      if(hst.os) { outp+=hst.os + " "; }
      if(hst.osver) { outp+=hst.osver; }
      outp+="</b></td></tr></table>";
    }

    for(var i=0; i<hst.services.length; i++) {
      if(i==0) { outp+="<b>Open services:</b><table id='tableservices'>"; }
	outp+="<tr><td width='30%'><i>" + hst.services_port[i] + "</i></td>";
	outp+="<td><b>" + hst.services[i] + "</b></td> ";
	if(hst.services[i]=='www') { outp+="<td><a href='http://" + hst.ip + "' target='_blank'>connect</a></td>"; }
	else if(hst.services[i]=='ftp') { outp+="<td><a href='ftp://" + hst.ip + "' target='_blank'>connect</a></td>"; }
	else if(hst.services[i]=='https') { outp+="<td><a href='https://" + hst.ip + "' target='_blank'>connect</a></td>"; }
	else { outp+= "<td></td>"; }
	outp+="</tr>";
      if(i==hst.services.length-1) { outp+="</table>"; }
    }

    if(hst.otherips) { 

      outp+="<b>Traffic routed from other subnets:</b><table id='tableservices'>";
      for(i=0; i<hst.otherips.length; i=i+3) {
	outp+="<tr><td>" + hst.otherips[i] + "</td>";
	if(i>1) { outp+=" <td>" + hst.otherips[i+1] + " </td>"; }
	if(i>2) { outp+="<td>" + hst.otherips[i+2] + " </td>"; }
	outp+="</tr>";
      }
      outp+="</table>";
    }

    document.getElementById("columnhost").innerHTML = outp;

}


function clearhost()
{
    document.getElementById("columnhost").innerHTML = "";
}

function showhidehost()
{
    if(document.hiddenhostinfo) {
      document.getElementById("columnhost").innerHTML=document.hiddenhostinfo;
      document.hiddenhostinfo=null;
      document.getElementById('columnhost').style.width='325px';	
    }
    else {
      document.hiddenhostinfo=document.getElementById("columnhost").innerHTML + ' ';
      clearhost();
      document.getElementById('columnhost').style.width='14px';	
    }

}